package javaseof10day.day6.am;

import java.awt.BorderLayout;
import java.awt.EventQueue;
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
import java.util.Vector;

import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
import javax.swing.table.DefaultTableModel;

import java.awt.Toolkit;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStream;

import javax.swing.JScrollPane;
import javax.swing.UIManager;
import javax.swing.UnsupportedLookAndFeelException;
import javax.swing.JTable;
 
public class FileWriterDemo  {
 


	public static void main(String[] args) throws IOException{
		
	

		//创建一个FileWriter对象，该对象初始化的时候就要指定被操作的文件   该文件不存在就会新建一个文件
				FileWriter file = null;
		
					file = new FileWriter("src/readme.txt");
					file.write("HelloWorld!");
					//刷新缓存数据将数据写入文件
					file.flush();
		 
					file.write("10天轻松学习Javase");
					file.write("10天轻松学习Javase");

		
					file.close();
					
					
					System.out.println("操作完成，查看src/readme.txt 文件内容");
			
	}
 
	

 
}
